<template>
	<view class="flex flex-dir-c">
		<view class="flex flex-jc-sa store-tabbar flex-ai-c" style="width: 100%;">
			<view v-for="(item,i) in tabbarList" :key="item.id" style="text-align: center;" @click="change(item)">
				<image :src="current == item.id ? item.selectedIconPath : item.iconPath"
					style="width: 40rpx;height: 40rpx;"></image>
				<view :style="{'color': current == item.id?'#FCB527':''}">{{item.text}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'componentTabbar',
		props: {
			current: {
				type: Number,
				default: -1
			}
		},
		data() {
			return {
				tabbarList: [{
						id: 0,
						pagePath: "", ///pages/index/store
						iconPath: "/static/tabBar/shop1.png",
						selectedIconPath: "/static/tabBar/shop.png",
						text: "线上商城", //线上商城
						centerItem: false
					},
					{
						id: 1,
						pagePath: "/pages/index/tabbar?index=1",
						iconPath: "/static/tabBar/order.png",
						selectedIconPath: "/static/tabBar/actice_order.png",
						text: "订单",
						centerItem: false
					},
					{
						id: 2,
						pagePath: "/pages/index/index?index=2",
						iconPath: "/static/tabBar/me.png",
						selectedIconPath: "/static/tabBar/active_me.png",
						text: "我的",
						centerItem: false
					}
				]
			}
		},
		mounted() {
			uni.hideTabBar()
		},
		methods: {
			change(e) {
				this.$emit('change',e)
			}
		}
	}
</script>
<style lang="scss" scoped>
	.store-tabbar {
		height: 150rpx;
		background: #fff;
	}
</style>